import sys
from PyQt5 import QtCore
from PyQt5.QtCore import QThread, pyqtSignal
from PyQt5.QtWidgets import QPushButton, QDialog, QApplication
import time

class BigThingThread(QThread):
    finished_signal = pyqtSignal(str, list)

    def __init__(self, rest, parent=None):
        super().__init__(parent)
        self._rest = rest

    def run(self):
        print('do something big')
        time.sleep(self._rest)
        t = [1, 2, 3]
        self.finished_signal.emit('done', t)

class Test(QtCore.QObject):
    def f(self):
        while 1:
            time.sleep(100)


class MyDialog(QDialog):
    def __init__(self, parent=None):
        super().__init__(parent)
        self.button = QPushButton(self)
        self.button.setText('干大事')
        self.button.clicked.connect(self._click_do_something)

    @staticmethod
    def _show_message(message, ts):
        print('{}'.format(message))

    def _click_do_something(self):
        # tmpTest = Test()
        # tmpThread = QThread()
        # tmpTest.moveToThread(tmpThread)
        # tmpThread.started.connect(tmpTest.f)
        # tmpThread.start()
        self.big_thread = BigThingThread(10)
        self.big_thread.finished_signal.connect(self._show_message)
        self.big_thread.start()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    dialog = MyDialog()
    dialog.show()
    sys.exit(app.exec_())